/*    */ package com.zimbra.cs.index.query;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.cs.index.DBQueryOperation;
/*    */ import com.zimbra.cs.index.QueryOperation;
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.service.util.ItemId;
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class ConvQuery
/*    */   extends Query
/*    */ {
/*    */   private final ItemId convId;
/*    */   
/*    */   private ConvQuery(ItemId convId)
/*    */     throws ServiceException
/*    */   {
/* 38 */     this.convId = convId;
/*    */     
/* 40 */     if (convId.getId() < 0) {
/* 41 */       throw ServiceException.FAILURE("Illegal Negative ConvID: " + convId + ", use ItemQuery for virtual convs", null);
/*    */     }
/*    */   }
/*    */   
/*    */   public static Query create(Mailbox mbox, String target) throws ServiceException
/*    */   {
/* 47 */     ItemId convId = new ItemId(target, mbox.getAccountId());
/* 48 */     if (convId.getId() < 0)
/*    */     {
/* 50 */       convId = new ItemId(convId.getAccountId(), -1 * convId.getId());
/* 51 */       List<ItemId> iidList = new ArrayList(1);
/* 52 */       iidList.add(convId);
/* 53 */       return new ItemQuery(false, false, iidList);
/*    */     }
/* 55 */     return new ConvQuery(convId);
/*    */   }
/*    */   
/*    */ 
/*    */   public boolean hasTextOperation()
/*    */   {
/* 61 */     return false;
/*    */   }
/*    */   
/*    */   public QueryOperation compile(Mailbox mbox, boolean bool)
/*    */   {
/* 66 */     DBQueryOperation op = new DBQueryOperation();
/* 67 */     op.addConvId(mbox, this.convId, evalBool(bool));
/* 68 */     return op;
/*    */   }
/*    */   
/*    */   public void dump(StringBuilder out)
/*    */   {
/* 73 */     out.append("CONV:");
/* 74 */     out.append(this.convId);
/*    */   }
/*    */   
/*    */   public void sanitizedDump(StringBuilder out)
/*    */   {
/* 79 */     out.append("CONV:");
/* 80 */     out.append("$NUM");
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/index/query/ConvQuery.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */